package cn.roadtrip.utilmodule.util.enumpck;

/**
 * 用户性别
 */
public enum Enum_UserSex {
    Secret("Secret", "保密"),
    Male("Male", "男"),
    FeMale("FeMale", "女");

    private String s;
    private String title;

    Enum_UserSex(String s, String title) {
        this.s = s;
        this.title = title;
    }

    Enum_UserSex(String s) {
        this.s = s;
        this.title = Enum_UserSex.parseCode(s).getTitle();
    }

    public String getTitle() {
        return this.title;
    }

    public String getCode() {
        return this.s;
    }

    public static final Enum_UserSex parseCode(String code) {
        switch (code) {
            case "Secret":
                return Secret;
            case "Male":
                return Male;
            case "FeMale":
                return FeMale;
        }
        return null;
    }

    @Override
    public String toString() {
        return "(code:%s, title:%s)".formatted(this.s, this.title);
    }
}
